The present invention relates to a programmable controller for controlling and/or monitoring a technical process, which controller is provided for performing at least one user-adaptable.
Referring to FIG. 6, a programmable controller is, for example, the central processing unit 110 of a programmable logic controller 120 which performs at least one user-adaptable task for controlling and/or monitoring a technical process 130 which is to be automated.
It is frequently possible to perform control functions in order to control and/or monitor a technical process. Such control functions are available to the user of the programmable controller in a library, for example. Simple control functions are, for example, control functions using the so-called P algorithm, in which the control function emulates a control unit with a proportional character, using the so-called PI algorithm, in which the control function emulates a control unit with a proportional/integral character, or using the so-called PID algorithm, in which the control function emulates a control unit with a proportional/integral/differential character.
Such control functions are in general use, so that they are frequently available in the form of libraries. The user uses the control function and specifies only the parameters, for example the proportionality factor or the lead time, depending on the application.
A control unit produced in this manner in a programmable controller is always a sampling control unit operating in discrete time. The respective control algorithm is geared to this fact. A sampling control unit is operated in a fixed sampling interval, the control unit being activated at the sampling instants in each case. In the case of a sampling control unit produced on a software basis, the control algorithm is activated, i.e., called, at the respective sampling instants.
For this purpose, the control algorithms may be held available in a library in the form of program sections or subroutines which can be called separately, or they may be programmed by the user depending on current requirements. The individual algorithm is then available to the overall program as a subroutine which can be called separately, and is integrated into the overall program as a module. Such a module which can be called separately and implements a specifiable functionality is also called an operating task in the following text.
In process control devices of the type described above, a central task is usually provided which guarantees that the control algorithms described above, for example, are called periodically by executing corresponding control statements. In this way, for example, it is possible, depending on the computational power of the process control device, for a specific control algorithm to be called periodically with a clock cycle of 200 ms. This cycle time corresponds to the sampling time and is entered as a parameter in the respective control algorithm.
When producing user programs for control purposes in programmable controllers, the use of, for example, the control functions described above, and alternatively the use of filters, set-point encoders, integrators, differentiators etc., requires these to be called in a defined time sequence.
In order to implement this call concept, it is frequently necessary to program a timing manager in order to utilize the cycle time of the controller uniformly. In addition to considerable effort in terms of working time, this also means that the user, the software producer, must specify the sampling times for each operating task, that the user must transfer the sampling time to each periodic operating task of the type described above since this sampling time is included as a parameter in the respective calculations, and that, in addition, the user must concern himself or herself with the timing management for each program.
This requires the user to have a good understanding of control engineering which is often lacking in traditional controller construction or in any case entails unnecessary programming and commissioning effort, particularly with slow procedures such as temperature control.
In addition, there is the risk that incorrect timing management will cause the programmable controller to enter an error state, which can still occur even after commissioning since superimposed asynchronous procedures with cycle time loads which are not negligible are involved, and these cycle time loads are very difficult to calculate without in-depth knowledge.
An object of the present invention is to provide a programmable controller in which one or more operating tasks can be called in the periodic part of the user-adaptable task, and the sampling time which is necessary for calculating the mathematical or logic function on which the algorithm of the respective operating task is based can be determined in each individual operating task and is therefore available as a parameter for the logic function.
This object is achieved by providing a programmable controller for controlling and/or monitoring a technical process, which controller is provided for performing at least one user-adaptable task, in particular a central processing unit of a programmable logic controller. The user-adaptable task is capable of calling at least one operating task.
The operating task receives at least one measured value from the technical process and determines at least one piece of data, referring to a measured value, on the basis of a specifiable mathematical or logic function defined by at least one parameter. The piece of data may be determined, referring to a measured value, when the operating task is called. The operating task determines the instant of the call. A time difference may be determined between the current call and a preceding call, the time difference being a parameter of the mathematical or logic function.
If the time difference between the current call and a preceding call can be determined by the operating task itself, it is not necessary to transfer this time difference to the operating task as a parameter. This reduces the computation time of the programmable controller and, in particular, relieves the load on the stack in which the data are temporarily stored during parameter transfer.
In programmable controllers which perform at least one user-adaptable task in order to control and/or monitor a technical process, so-called real-time execution is normally provided, that is to say that, within certain limits, the operating system or a task on which the user-adaptable task is superimposed ensures that actions are initiated at precise, specifiable instants. In the present case, the task which is called the central task in the following text is, for example, the task described above on which the user-adaptable task is superimposed, or a task which is called by the specific operating system.
If the user-adaptable task can be controlled by this central task, it is possible, for example, to call the user-adaptable task periodically within fixed time intervals. If the operating tasks described above are called from a user-adaptable task which is controlled in this way, the defined call frame of the user-adaptable task also guarantees a call frame, defined within certain limits, for the operating task, with the result that this roughly establishes the relationships again which already exist when the operating task is called by the central task according to the prior art, but with a significant reduction in programming and planning effort as well as a reduction in the amount of computation time for the programmable controller.
If at least one time index task is provided in addition to the user-adaptable task, it being possible for the time index task to be called by the central task, and the time index task incrementing the contents of a time index register with each call, the contents of the time index register can be used to make a common time base available for all operating tasks.
The time index task is called by the central task at specifiable instants, the time index task incrementing at least the contents of one time index register with each call. The call instants of the time index task depend on the smallest so-called section time constant of the technical process to be controlled and/or monitored. The interval between two call instants of the time index task is therefore usually chosen to be smaller than the smallest section time constant of the technical process.
The interval between two call instants of the time index task must, in turn, be chosen to be of such a size that the time period between a first overflow of the time index register and a second overflow of the time index register is greater, in particular significantly greater, than the largest section time constant detected.
If the time index task increments the contents of the time index register with each call, a sawtooth function is produced if the contents of the time index register are plotted against time, since the register contents become zero immediately after a register overflow and, consequently, are subsequently incremented starting from zero again. The time index register is a so-called global register, so that the contents of the time index register can be determined both by the overall program as well as by all the subroutines, in particular by the operating tasks which are performed by the programmable controller.
If the time index task can be called by the central task in a specifiable, equidistant time frame, the contents of the time index register cause a linear time base to be produced for the overall program, the subroutines which can be called and the operating tasks in particular.
If, in order to determine its call instant, the operating task determines the contents of the time index register, it is particularly simple to determine the call instant additionally referring, as described above, to the common time base of the overall program, the subroutines which can be called and the operating task in particular.
Another object of the present invention is to provide a method for calling an operating task in a programmable controller, in particular a central processing unit of a programmable logic controller for controlling and/or monitoring a technical process, which controller is provided for performing at least one user-adaptable task, by means of which process the operating tasks are called in the periodic part of the user-adaptable task and in which process the sampling time required for calculating the mathematical or logic function on which the algorithm of the respective operating task is based is determined in each individual operating task and is therefore available as a parameter for the logic function.
This object is achieved by providing a method for calling an operating task in a programmable controller, in particular a central processing unit of a programmable logic controller, for controlling and/or monitoring a technical process, which controller is provided for performing at least one user-adaptable task. The object is achieved by providing a method in which object being achieved by virtue of the fact the operating task is called by a user-adaptable task. The operating task receives at least one measured value from the technical process and determines at least one piece of data, referring to a measured value, on the basis of a specifiable mathematical or logic function defined by at least one parameter. The piece of data referring to the measured value is determined when the operating task is called. The operating task determines the instant of the call. A time difference is determined between the current call and a preceding call. The time difference is a parameter of the mathematical or logic function.